import java.net.ServerSocket;
import java.net.Socket;

public class CloudFileServer {
    public static void main(String[] args) {
        try {
            //注册端口
            ServerSocket serverSocket = new ServerSocket(8888);
            //循环等待客户端连接
            while (true) {
                //监听客户端连接
                Socket socket = serverSocket.accept();
                //客户端连接服务端后，把客户端的socket管道单独配置一个线程来处理
                new ServerReader(socket).start();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}